<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>


<isperp:grid gridId="projectGrid" url="project/project/configList"
	autoReloadTreeMenu="projectMenu" gridTitle="${pageTitle}"
	processKey="projectProcess" editOrDeleteRightControl="true"
	ondbClickRowEvent="projectGrid.edit(rowid);" sortname="code"
	sortorder="desc" cusDeleteUrl="project/project/delete">
	<jsp:attribute name="toolbar">	
	<isperp:treeMenu id="projectMenu" targetGridId="projectGrid">
		<isperp:async enable="true" url="project/project/configMenu"></isperp:async>
		<isperp:callback onClick="projectMenuTree_onNodeClick"
				onAsyncSuccess="projectMenuTree_onNodeClickFirst();">
		</isperp:callback>
	</isperp:treeMenu>

	<isperp:toolbar id="projectToolbar">
	    <isperp:button id="projectCreate" icon="icon-plus" text="新增项目"
				cssClass="nui-mainbtn" onclick="projectGrid.create();"></isperp:button>
	</isperp:toolbar>
	</jsp:attribute>

	<jsp:attribute name="searchbar">
	<table class="search-table">
		<tbody>
			<tr>
				<td class="td1">项目编号：</td>
				<td class="td2"><input type="text" field="code" op="cn">
				</td>
				<td class="td1">项目名称：</td>
				<td class="td2"><input type="text" field="name" op="cn">
				</td>
				<td class="td1">项目经理：</td>
				<td class="td2"><input type="text" field="managerName" op="cn">
				</td>
				
				
			</tr>
			<tr>
			    <td class="td1">项目类型：</td>
				<td class="td2">	
						<isperp:dictSelector typeCode="PROJECT_TYPE"
							field="projectType" op="eq" name="projectType"
							id="projectType" hasEmptyValue="true"></isperp:dictSelector>
				</td>
			    <td class="td1">合同编号：</td>
				<td class="td2" colspan="3"><input type="text"
						field="contractNo" op="in" style="width: 80%"
						placeholder="多个合同编号搜索可用逗号（,）隔开，如（CT01,CT02）">
				</td>

			</tr>
		</tbody>
	</table>
	</jsp:attribute>
	<jsp:body>
	<isperp:column name="id" title="id" hidden="true"></isperp:column>
	<%-- <isperp:column name="projectLevel" align="center" title="" width="28"
			isFormatterFun="true" formatter="return statusFormatter(cellvalue);">
	</isperp:column> --%>
	<isperp:column name="code" title="项目编号" width="100">
	</isperp:column>
	<isperp:column name="name" title="项目名称" width="160">
	</isperp:column>
	<isperp:column name="contractNo" title="合同编号" width="160">
	</isperp:column>
	<isperp:column name="projectType" title="项目类型" width="80">
	</isperp:column>
	<isperp:column name="cusCustomerName" title="客户" width="120">
	</isperp:column>
	<isperp:column name="status" title="状态" width="60">
	</isperp:column>
	<isperp:column name="creatorName" title="创建人" width="70">
	</isperp:column>
   </jsp:body>
</isperp:grid>


<isperp:operate code="PROJ_CONFIG"></isperp:operate>
<script type="text/javascript">
	function statusFormatter(cellvalue) {
		if (cellvalue == 'A级')
			return "<img title='A级项目' src='img/project/pa.png'>";
		else if (cellvalue == 'B级')
			return "<img title='B级项目' src='img/project/pb.png'>";
		else if (cellvalue == 'C级')
			return "<img title='C级项目' src='img/project/pc.png'>";
		else if (cellvalue == 'D级')
			return "<img title='D级项目' src='img/project/pd.png'>";
		else if (cellvalue == 'E级')
			return "<img title='E级项目' src='img/project/pe.png'>";
	}
</script>